﻿using System;
using System.Collections.Generic;
using System.Data.Common;

namespace LDataAccess
{
    public class ProxyManager: IDisposable
    {
        private Dictionary<string, ProxyClass> proxylist;

        public ProxyManager()
        {
            proxylist = new Dictionary<string, ProxyClass>();
        }

        public void AddProxy(string name, ProxyClass proxy)
        {
            if (proxylist!=null && !proxylist.ContainsKey(name))
                proxylist.Add(name, proxy);
        }

        public ProxyClass GetProxy(string name)
        {
            ProxyClass pout;
            proxylist.TryGetValue(name, out pout);

            return pout;
        }

      
        public void Dispose()
        {
            proxylist.Clear();
        }

    }

}
